1. Technical Field
The present invention relates to a switching state detecting device for a switch and to an electronic apparatus, and particularly relates to a switching state detecting device for a switch capable of detecting the switching state of a switch with lower electric power consumption and high precision, and to an electronic apparatus using this device.
2. Background Art
With common electronic apparatuses, various operations are performed by switches, but with electronic apparatuses which require low electrical power consumption, ways of keeping electric power consumed by detecting circuits to a minimum have been devised, in that the switching states of the switches are not continuously detected, but intermittently detected.
Description will be made regarding a configuration for detecting the switching state of switches used for such electronic apparatuses, with reference to FIG. 17. As shown in the Figure, one end of the switch SW regarding which the switching state is to be detected is grounded at a reference level Vdd at the high-potential side, and the other end is connected to a detecting circuit 900. Now, the detecting circuit 900 is made up of an n-channel field-effect transistor 910 and a latch circuit 930, with the drain of the transistor 910 being connected to the other end of the switch SW, and the source thereof connected to the negative side power source voltage Vss. Also, sampling pulses SP are supplied to the gate of the transistor 910.
The latch circuit 930 latches the voltage level of the signal line A connected to the other end of the switch SW with the trailing edge of the sampling pulse SP, and outputs a signal Out indicating the switching state of the switch SW.
With such a detecting circuit 900, the transistor 910 is on only during the period wherein the sampling pulse SP is at the xe2x80x9cHxe2x80x9d level, and the signal line A is pulled down to the power source voltage Vss by the on resistance thereof. According, the voltage level of the signal line A maintains the power source voltage Vss in the event that the switch SW is open during the period wherein the sampling pulse SP is at the xe2x80x9cHxe2x80x9d level, but conversely makes transition to the ground level in the event that the switch SW is closed.
Accordingly, a signal Out according to the switching state of the switch SW can be output by the latch circuit 930 latching the voltage level of the signal line A with the leading edge of the sampling pulse SP. Then, processing corresponding to the instruction of the switch is executed by a later circuit (omitted in the drawings) based on this signal out.
According to such a detecting circuit 900, no electrical current is constantly flowing between the drain/source of the transistor 910, so the electricity consumed in the detecting circuit 900 can be kept low.
Now, depending on the electronic apparatus applied, the power source voltage Vss may not be constant but vary with a certain width. For example, in the case of an electronic apparatus comprising an electricity generating mechanism and a battery mechanism, wherein the electricity generated by the electricity generating mechanism is stored in the battery mechanism, and the electricity stored in the battery mechanism is used as the power source, fluctuation of the power source voltage Vss due to the battery state is presupposed.
Now, general transistors have a nature wherein the lower the voltage between the source/drain is, the greater the on resistance thereof is, i.e., in straightforward terms, the resistance value properties as to voltage are non-linear. On the other hand, pulling down the signal line A with high resistance tends to make the voltage level thereof unstable. Accordingly, a transistor 910 of a type with a small on resistance must be used in order to stabilize the voltage level of the signal line A, whether the voltage between source/drain is low, or whether the difference between the power source voltage Vss and ground level is small.
However, with a configuration wherein the signal line A is pulled down with a transistor having small on resistance, the electric power consumption of the detecting circuit 900 has to increase, so not only does this go against the original object of lowering electric power consumption, but further creates a problem in that the range of power source voltage capable of detecting the switching state of the switch is restricted due to transistor properties.
This problem is marked in cases wherein the sampling rate is increased, in order to detect the switching state of the switch SW with high precision. The reason is as follows. That is, the line for the signal line A has parasitic capacity owing to the transistor 910, pads for extending lines for mounting, wiring, etc. Now, in the event that a charge is stored in this parasitic capacity due to some reason in the state of the switch SW being open, when the sampling pulse SP is at the xe2x80x9cHxe2x80x9d level the level of the signal line A changes over time according to a time-constant owing to the parasitic capacity and pulldown resistance. Accordingly, the signal line A is not determined at the xe2x80x9cLxe2x80x9d level state wherein the switch SW is open, until after pulling down for a certain amount of time. Thus, in order to raise the sampling rate, the pulse width of the sampling pulse SP must be secured to a certain level in order to take sufficient time for the level of the signal line A to be determined. This means nothing else than extending the amount of on time at the transistor 910.
The present invention has been made in light of the above problems, and it is an object thereof to provide a switching state detecting device for a switch capable of realizing both widening the power source voltage range capable of detecting the switching state of the switch, and improving detection precision of the switching state of the switch, and an electronic apparatus using this device.
A first form of the present invention comprises: a switch connected at one end to a ground line or a power source; a resistive element connected between the other end of the switch and a power source or a ground line; and a control unit for controlling the value of the resistive element based on a power source voltage which is the difference between the voltage level of the power source and the ground level of the ground line; wherein signals equivalent to the switching state of the switch corresponding to the voltage level at the other end of the switch are output.
Further, the first form of the present invention comprises a judging unit for judging, or determination unit that determines the voltage level at the other end of the switch and outputting signals equivalent to the switching state of the switch.
Further, the determination unit of the first form of the present invention performs determination of the voltage level at predetermined intervals.
Also, the control unit of the first form of the present invention controls the resistance value of the resistive element such that the resistance value of the resistive element does not exceed the predetermined upper limit resistance value.
Also, the control unit of the first form of the present invention controls the resistance value of the resistive element such that the resistance value of the resistive element is within the resistive element value range stipulated by the predetermined upper limit resistance value and lower limit resistance value.
Also, the resistive element of the first form of the present invention is a variable resistive element that changes resistance value based on the power source voltage; and wherein the control unit controls the resistance value of the resistive element to a virtual resistance value when an absolute voltage level of the power source is higher than a predetermined reference voltage; and wherein the control unit controls the resistance value of the resistive element to be smaller than the virtual resistance value when the absolute voltage level of the power source is lower than the predetermined reference voltage.
Further, the resistive element of the first form of the present invention is configured of a plurality of sub-resistive elements, wherein the control unit controls the resistance values of the resistive elements connected between the other end of the switch and power source or ground line, based on the power source voltage.
Further, the resistive element of the first form of the present invention is configured of a plurality of sub-resistive elements having generally the same on-resistance value, wherein in the event that the power source voltage is lower than the predetermined reference voltage the control unit connects in parallel a greater number of on-resistance values of the sub-resistive elements than the number of on-resistance values of sub-resistive elements that are connected in the event that the power source voltage is higher than the predetermined reference voltage.
Also, the resistive element of the first form of the present invention is configured of a plurality of sub-resistive elements having mutually different on-resistance values, wherein the control unit selects from the on-resistance values of the plurality of sub-resistive elements one or multiple on-resistance values of the sub-resistive elements connected between the other end of the switch and power source or ground line, based on the power source voltage.
Also, the control unit of the first form of the present invention has predetermined mutually different multiple reference voltages.
Also, the resistive element of the first form of the present invention is a transistor that is turned on for intervals matching the timing for determining the voltage level at the other end of the switch.
Further, the first form of the present invention comprises: a switch connected at one end to a ground line or a power source; a resistive element connected between the other end of the switch and a power source or a ground line; and a resistive element value switching circuit for switching the value of the resistive element based on power source voltage which is the difference between the voltage level of the power source and the ground level of the ground line; wherein the voltage level at the other end of the switch is judged and signals equivalent to the switching state of the switch corresponding to the voltage level at the other end of the switch are output.
Further, the first form of the present invention comprises a latch circuit for determining the voltage level at the other end of the switch and outputting signals equivalent to the switching state of the switch.
Further, the latch circuit of the first form of the present invention determines the voltage level at predetermined intervals.
Also, the resistive element of the first form of the present invention is a variable resistive element that changes resistance value based on the power source voltage; and wherein the resistance value switching circuit switches the resistance value of the resistive element to a virtual resistance value when an absolute voltage level of the power source is higher than a predetermined reference voltage; and wherein the resistance value switching circuit switches the resistance value of the resistive element to be smaller than the virtual resistance value when the absolute voltage level of the power source is lower than the predetermined reference voltage.
A second form of the present invention comprises: a power source for supplying electric power; a voltage detecting unit for detecting the voltage of the power source; a switch connected at one end to a ground line or a power source; a resistive element connected between the other end of the switch and a power source or a ground line; a control unit for controlling the value of the resistive element based on power source voltage which is the difference between the voltage level of the power source detected by the voltage detecting unit and the ground level of the ground line; a determination unit that determines the voltage level at the other end of the switch, and outputs signals corresponding to the switching state of the switch; and a processing unit that executes processing in accordance with a switching state of the switch represented by signals output by the determination unit.
Further, the determination unit of the present invention determines the voltage level at predetermined intervals.
Also, the resistive element of the second form of the present invention is a variable resistive element which changes resistance value based on the power source voltage; and wherein the control unit controls the resistance value of the resistive element to a virtual resistance value when an absolute voltage level of the power source is higher than a predetermined reference voltage; and wherein the control unit controls the resistance value of the resistive element to be smaller than the virtual resistance value when the absolute voltage level of the power source is lower than the predetermined reference voltage.
Also, the processing unit of the second form of the present invention comprises a timing unit for executing various timing processes in accordance with the switching state of the switch.
Also, the power source of the second form of the present invention contains a battery unit for storing electric power generated by an electricity generating unit.
Further, the second form of the present invention comprises a voltage control unit for controlling output voltage from the battery unit, in accordance with the voltage detected by the voltage detecting unit.